
*Initialize work environment
clear all
set more off
set maxvar 10000
set seed 94678442 
version 16

* === Set directories ===

* [REQUIRED] Set this to the location where the replication files are stored
* Users must edit this line to point to the correct local folder
global swdLocal "[INSERT YOUR LOCAL PATH HERE]"

* Change to working directory
cd "${swdLocal}"
	
* Run init
do "00-init.do"

*** 1. Balance testing
* Testing for balancing at baseline
do "${gsdDo}\1-1-BalancingBaseline"
* Testing for attrition bias 
do "${gsdDo}\1-2-AttritionTests"
* Testing for balancing between treatment 1 and treatment 2
do "${gsdDo}\1-3-BalancingTreatment1Treatment2"
* Re-do indices
do "${gsdDo}\1-4-GenIndices"

*** 2. Validity of the instrument
* validity test*
do "${gsdDo}\2-1-Validity" 

*** 3 Regressions 
* First stage
do "${gsdDo}\3-1-FirstStage"
* LATE "training and grant" vs. "training, no grant"
do "${gsdDo}\3-2-RegressionsT1T2" 

*** 4. Robustness
* two instruments
do "${gsdDo}\4-1-RegressionsT1T2_2IV"
* sensitivity bounds LATE
do "${gsdDo}\4-2-BoundsLATE"
* Robustness conflict LATE
do "${gsdDo}\4-3-RobustnessConflictLATE"
* Robustness replacement observations ITT
do "${gsdDo}\4-4-RobustnessSampleLATE"
*rho-Test
do "${gsdDo}\4-5-rho-Test.do"
*tF-confidence intervals
do "${gsdDo}\4-6-tF-confidence"
* calculating MDEs
do "${gsdDo}\4-7-PowerTesting"
*Gender Analysis
do "${gsdDo}\4-8-RegressionsT1T2_singleIV_Male"
do "${gsdDo}\4-9-RegressionsT1T2_singleIV_Female"
do "${gsdDo}\4-10-gender_heterogeneity"

* Index components analysis
do "${gsdDo}\5-1-ConsumptionAnalysis"
do "${gsdDo}\5-2-Trust"
do "${gsdDo}\5-3-Savings"
